/**
 * Created with JetBrains WebStorm.
 * User: Tao
 * Date: 13-3-17
 * Time: 下午2:28
 * To change this template use File | Settings | File Templates.
 */
Ext.application({

    name:'Demo',

    launch:function(){

        var formPanel = Ext.create('Ext.form.Panel',{

            id:'formPanel',
            scrollable:'vertical',

            items:[
                {
                    xtype:'numberfield',
                    label:'年龄',
                    placeHolder:'请输入年龄',
                    required:true
                },{
                    xtype:'radiofield',
                    label:'男性',
                    value:'male',
                    checked:true,
                    name:'sex'
                },{
                    xtype:'radiofield',
                    label:'女性',
                    value:'female',
                    checked:false,
                    name:'sex'
                },{
                    xtype:'selectfield',
                    name:'genre',
                    label:'种类',
                    options:[{
                        text:'喜剧',
                        value:'1'
                    },{
                        text:'文艺',
                        value:'2'
                    },{
                        text:'运动',
                        value:'3'
                    }

                    ]
                }
            ]
        });

        for(var i = 0;i<15;i++){

            var field = Ext.create('Ext.form.Text',{
                id:'txt_field'+i,
                label:'标签'+i,
                value:'实例文字'+i
            });
            formPanel.add(field);
        }

        Ext.Viewport.add(formPanel);
//        formPanel.getScrollable().getScroller().setFps(100);
//        formPanel.getScrollable().getScroller().scrollTo(0,200);
        formPanel.getScrollable().getScroller().scrollToEnd();
    }
})
